package homework;

class SingletonLazy {
    private static volatile SingletonLazy instance = null;
    private static Object locker = new Object();

    public static SingletonLazy getInstance(){
        if (instance == null) {
            synchronized(locker){
                if (instance == null) {
                    instance = new SingletonLazy();
                }
            }
        }
        return instance;
    }
    private SingletonLazy(){
        System.out.println("SingletonLazy 构造方法");
    }
}
public class demo9 {

}
